{% load forum_tags %}
{% load accounts_tags %}

{% with params=request.GET.urlencode %}
    <div class="ui small compact menu no-shadow">
        <div class="ui simple dropdown item">
            <i class="{% get_icon string=limit default='all' %}"></i>
            <span class="tablet">Show</span>
            <i class="dropdown icon"></i>

            <div class="menu">
                <a class="item" href="{% relative_url 'all' 'limit' params %}">
                    <i class="list icon"></i>all
                </a>
                <a class="item" href="{% relative_url 'questions' 'limit' params %}">
                    <i class="question mark icon"></i>questions
                </a>
                <a class="item" href="{% relative_url 'tools' 'limit' params %}">
                    <i class="cogs icon"></i>tools
                </a>

                <a class="item" href="{% relative_url 'blogs' 'limit' params %}">
                    <i class="file icon"></i>blogs
                </a>
                <a class="item" href="{% relative_url 'news' 'limit' params %}">
                    <i class="newspaper icon"></i>news
                </a>
                <a class="item" href="{% relative_url 'tutorials' 'limit' params %}">
                    <i class="help icon"></i>tutorials
                </a>
                <a class="item" href="{% relative_url 'forum' 'limit' params %}">
                    <i class="list icon"></i>forum
                </a>
                <a class="item" href="{% relative_url 'answers' 'limit' params %}">
                    <i class="{% get_icon 'week' %}"></i>answers
                </a>
                <a class="item" href="{% relative_url 'comments' 'limit' params %}">
                    <i class="{% get_icon 'month' %}"></i>comments
                </a>

            </div>
        </div>
    </div>
{% endwith %}

{% if limit %}
    <div class="ui blue message"> Showing :<b> {{ limit }}</b></div>
{% endif %}

<div class="ui divided items">
    {% get_post_list request=request target=target show=limit as post_list %}

    {% for post in post_list %}
        {% post_details post=post user=request.user %}
    {% empty %}
        <div class="ui warn message">
            No posts found.
        </div>
    {% endfor %}
    <div class="ui page-bar segment">
        {% pages objs=post_list %}
    </div>

</div>
